
	
*============================================ APPENDIX FIGURES =================================================================*


*------------------------------------------------------------------------------------
* FIGURE A.1 
*------------------------------------------------------------------------------------

		use "$repfinaldata/matchedloans_finalsample.dta", clear 


		** PANEL A: Share of Households that are Fully Insurable by Ventiles of Property Value

			gen fullyinsured = r2<250000
			
			binscatter fullyinsured OriginalPropertyValue  if inrange(OriginalPropertyValue, 75000, 500000) , ///
				xline(250000) nq(20) line(none) xlab(0(100000)500000, grid) ylab(0(.2)1, grid) ytitle("Share With Replacement Cost < 250K") xtitle("Property Value") 
				
			graph export "$repoutput/binscatter_repcost_hval.png", as(png) replace 


		** PANEL B: Structure Share of Property

			gen sharestructure = rs_BuildingAreaSqFt / (LotSizeSquareFeet)
			*replace sharestructure = 1 if sharestructure >= 1 
			replace sharestructure = . if mi(rs_BuildingAreaSqFt) | mi(LotSizeSquareFeet)
			hist sharestructure if sharestructure<1, frac
			graph export "$repoutput/hist_landvalue.png", as(png) replace 

		** PANEL C: DOLLAR-PER-SQUARE-FOOT 
			hist dollar_per_sqfoot if dollar_per_sqfoot < 200, frac
			graph export "$repoutput/hist_dollarpersqft.png", as(png) replace 

**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.2, PANEL A 
**-----------------------------------------------------------------------------------------------------------------
	
	
	*create a local variable for house prices
	local hprices 50000 100000 150000 200000 250000 300000 350000 400000 450000 500000 550000 600000 650000 700000 750000 10000000000
	
	*gulf  states
	use "$repfinaldata/FOIA_sample_claims", clear
	drop if buildingvalue==0 
	drop if nfipbuildingcoverage>250000
	keep if inlist(state, "FL", "TX", "MS", "AL", "LA") // gulf states 
	egen buildingvalue_cat = cut(buildingvalue), at(0 `hprices') label
	collapse (mean) mean_damage=amountofdamageforbuilding mean_claim=amountpaidbynfipforbuilding mean_coverage=nfipbuildingcoverage ///
	(p25) p25_damage=amountofdamageforbuilding  p25_claim=amountpaidbynfipforbuilding p25_coverage=nfipbuildingcoverage ///
	(p50)  p50_damage=amountofdamageforbuilding p50_claim=amountpaidbynfipforbuilding p50_coverage=nfipbuildingcoverage ///
	(p75)  p75_damage=amountofdamageforbuilding p75_claim=amountpaidbynfipforbuilding p75_coverage=nfipbuildingcoverage ///
	(p90)  p90_damage=amountofdamageforbuilding p90_claim=amountpaidbynfipforbuilding p90_coverage=nfipbuildingcoverage ///
	(p95)  p95_damage=amountofdamageforbuilding p95_claim=amountpaidbynfipforbuilding p95_coverage=nfipbuildingcoverage ///
	(p97)  p97_damage=amountofdamageforbuilding p97_claim=amountpaidbynfipforbuilding p97_coverage=nfipbuildingcoverage ///
	(p98)  p98_damage=amountofdamageforbuilding p98_claim=amountpaidbynfipforbuilding p98_coverage=nfipbuildingcoverage ///
	(p99)  p99_damage=amountofdamageforbuilding p99_claim=amountpaidbynfipforbuilding p99_coverage=nfipbuildingcoverage ///
	(count) num_claims=amountpaidbynfipforbuilding (min) min_hvalue=buildingvalue (max) max_havlue=buildingvalue, by(buildingvalue_cat)

	unab varlist: p* mean*
	foreach var in `varlist' {
		label var `var' "`var'" 
		}
	
	format min_hvalue %12.2gc
	format *_claim %12.2gc

	format min_hvalue %15.2gc
	drop if buildingvalue >14
	gen min_hvalue_thou = min_hvalue / 1000 
	foreach var in mean p50 p75 p90 p95 p97 p99  {
		cap noi gen `var'_claim_thou =`var'_claim/1000
		}


	
	graph twoway scatter ///
		mean_claim_thou p50_claim_thou p75_claim_thou p90_claim_thou min_hvalue_thou, ///
		xtitle("FEMA Replacement Cost Estimates" "(Thousands$)", size(med))  ///
		ytitle("Flood Insurance Claims" "(Thousands$)", size(med)) ///
		legend(rows(1) ///
		order(1 "Mean" 2 "Median" 3 "p75" 4 "p90") ///
		nobox ///
		region(lcolor(white))) ///
		ylab(, labsize(med)) ///
		xlabel(0(100)700,valuelab labsize(med)) ///
		xline(250, lcolor(cranberry)) yline(250, lcolor(cranberry)) ///
		graphregion(fcolor(white) lcolor(white)) plotr(margin(large)) ///
		color("$pgp_blue" "$pgp_red" "$pgp_yellow" "$pgp_green" cranberry) ///
		msymbol(O D T S X)
	graph export "$repoutput/claim_by_hval_gulf.png", as(png) replace
		
	
**-------------------------------------------------
** FIGURE A.2, PANEL B 
**------------------------------------------------

	
	// Histogram of Replacement Cost by SHFA (A.2, Panel B)
	use "$repfinaldata/matchedloans_finalsample.dta", clear
	graph twoway ///
		(histogram r2_thou if I_SHFA==1 & r2_thou<1000, fraction color("$pgp_yellow") ) ///
		(histogram r2_thou if I_SHFA==0 & r2_thou<1000, fraction ///
		fcolor(none) lcolor(black)) ///
		(scatteri 0 250 .15 250, color(cranberry) c(l) m(i)), ///
		legend(order(1 "In Flood Zone" 2 "Outside Flood Zone" ) region(lcolor(white))) ///
		graphregion(fcolor(white) lcolor(white) margin(0)) ///
		xtitle("") xtitle("Replacement Cost (Thousands)", size(large)) ytitle("Fraction", size(large))
	graph export "$repoutput/hist_replacementcost_SHFA.png", as(png) replace 



	

**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.3 
**-----------------------------------------------------------------------------------------------------------------

	use "$repfinaldata/matchedloans_finalsample.dta", clear 

	reghdfe OriginalLTV I.purchaser_type2 I_SHFA_final#I.purchaser_type2 ///
		OriginalCreditScore_reg I_mi_Credit log_hmda_income log_OriginalProperty, absorb(fegroup) cl(FIPS)
	eststo  purchasertype
	
	coefplot purchasertype, ///
		keep(1.I_SHFA_final#*.purchaser_type2)  baselevel ///
		label xline(0) ///
		coeflabels(1.I_SHFA_final#2.purchaser_type2= "Other Government (Farmer Mac/Ginnie)" ///
		1.I_SHFA_final#3.purchaser_type2="GSE (Fannie/Freddie)" ///
		1.I_SHFA_final#6.purchaser_type2 = "Private Financial" 1.I_SHFA_final#8.purchaser_type2="Affiliate / Not Sold"  ///
		1.I_SHFA_final#10.purchaser_type2="Jumbo" , wrap(20)) 
	graph export "$repoutput/coefplot_purchaser_grouped.png", as(png) replace 

	
	reghdfe OriginalInterestRate I.purchaser_type2 I_SHFA_final#I.purchaser_type2 ///
		OriginalCreditScore_reg I_mi_Credit log_hmda_income log_OriginalProperty, absorb(fegroup) cl(FIPS)
	eststo  purchasertype_rate
	
	coefplot purchasertype_rate, ///
		keep(1.I_SHFA_final#*.purchaser_type2)  baselevel ///
		label xline(0) ///
		coeflabels(1.I_SHFA_final#2.purchaser_type2= "Other Government (Farmer Mac/Ginnie)" ///
		1.I_SHFA_final#3.purchaser_type2="GSE (Fannie/Freddie)" ///
		1.I_SHFA_final#6.purchaser_type2 = "Private Financial" ///
		1.I_SHFA_final#8.purchaser_type2="Affiliate / Not Sold"  ///
		1.I_SHFA_final#10.purchaser_type2="Jumbo" , wrap(20)) 
	graph export "$repoutput/coefplot_purchaser_grouped_rate.png", as(png) replace 
	
		 
		

**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.4 
**-----------------------------------------------------------------------------------------------------------------
	use "$repfinaldata/matchedloans_finalsample.dta", clear 
	* generate replacement cost categories 
	summ r2, d
	egen repval_cat = cut(r2), at(0 75000 100000 125000 150000 175000 200000 225000 250000 275000 300000 325000 350000 375000 400000 425000 450000 475000 500000 `r(max)') label
	tabstat r2, by(repval_cat) stat(min max mean)
	format r2_thou %9.4gc
	decode(repval_cat), gen(repval)
	replace repval = subinstr(repval, "-", "", .)
	destring(repval), replace
	drop if mi(repval)
	gen repval_thou = repval/1000

	
	reghdfe OriginalLTV b1.repval_cat##I_SHFA_final $controls_ltv if repval_cat>0, cl(FIPS) absorb(fegroup)
	parmest,format(estimate min95 max95 %8.4f p %8.4e) saving($repoutput/parmest_cap_repval_ltv, replace) 
	reghdfe OriginalInterestRate b1.repval_cat##I_SHFA_final $controls_ltv if repval_cat>0, cl(FIPS) absorb(fegroup)
	parmest,format(estimate min95 max95 %8.4f p %8.4e) saving($repoutput/parmest_cap_repval_rate, replace) 
	reghdfe I_del b1.repval_cat##I_SHFA_final $controls_ltv if repval_cat>0, cl(FIPS) absorb(fegroup)
	parmest,format(estimate min95 max95 %8.4f p %8.4e) saving($repoutput/parmest_cap_repval_30delinq, replace) 
	
	
	// MAKING THE GRAPHS(full controls)
	foreach var in ltv rate 30delinq  { 
	
		use $repoutput/parmest_cap_repval_`var', clear 
		
		split(parm), parse(#)
		gen group = "int" if strpos(parm2, "I_SHFA_final")>0
		replace group = "" if strpos(parm2, "0b")>0	
		keep if !mi(group)
		drop parm2 group 
		rename parm1 repval_cat 
		replace repval_cat = subinstr(repval_cat, ".repval_cat", "", .)
		rename repval_cat repval_cat_str

		destring(repval_cat_str), gen(repval_cat) force	
		replace repval_cat = 1 if repval_cat_str=="1b"
		gen repval = . 
		replace repval =  0 if repval_cat == 0
		replace repval =  75000 if repval_cat == 1
		replace repval =  100000 if repval_cat == 2
		replace repval =  125000 if repval_cat == 3
		replace repval =  150000 if repval_cat == 4
		replace repval =  175000 if repval_cat == 5
		replace repval =  200000 if repval_cat == 6
		replace repval =  225000 if repval_cat == 7
		replace repval =  250000 if repval_cat == 8
		replace repval =  275000 if repval_cat == 9
		replace repval =  300000 if repval_cat == 10
		replace repval =  325000 if repval_cat == 11
		replace repval =  350000 if repval_cat == 12
		replace repval =  375000 if repval_cat == 13
		replace repval =  400000 if repval_cat == 14
		replace repval =  425000 if repval_cat == 15
		replace repval =  450000 if repval_cat == 16
		replace repval =  475000 if repval_cat == 17
		replace repval =  500000 if repval_cat == 18

		// base level 
		gen estimate2 = estimate * 100 * 100 
		gen min95_2 = min95 * 100 * 100 
		gen max95_2 = max95 * 100 * 100 
		replace estimate2 = 0 if repval_cat_str=="1b"
		replace min95_2 = 0 if repval_cat_str=="1b"
		replace max95_2 = 0 if repval_cat_str=="1b"
		
		gen repval2 = repval/1000
		format repval %15.2gc		
		
		local ynote_ltv "-500(150)100"
		
		graph twoway ///
			(scatter estimate2 repval2, color("$pgp_blue")) ///
			(rcap min95_2 max95_2 repval2, color("$pgp_blue")), ///
			yline(0, lcolor(black)) ///
			xline(250, lcolor(cranberry)) ///
			xlab(, labsize(large)) ///
			ylab(`ynote_`var'', labsize(large)) ///
			graphregion(fcolor(white) lcolor(white) ) ///
			legend(order(1 "Estimate" 2 "95% Confidence Interval") region(lcolor(white)) size(large)) ///
			xtitle("Replacement Cost (Thousands)", size(large)) ///
			ytitle("Coefficient Estimates {&phi}{sub:k}" "(Basis Points)", size(large)) title("")
			
		graph export "$repoutput/repval_rkd_coeff_`var'_bp.png", as(png) replace 
	}

	
	

**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.5  
**-----------------------------------------------------------------------------------------------------------------

	** Continuous Around the boundary 
	use "$repfinaldata/matchedloans_finalsample.dta", clear 

	* doing the continuous version of above/below cap
	egen repval_cat = cut(r2), at(0 75000 100000 125000 150000 175000 200000 225000 250000 275000 300000 325000 350000 375000 400000 425000 450000 475000 500000 `r(max)') label

	format r2_thou  %9.4gc
	decode(repval_cat), gen(repval)
	replace repval = subinstr(repval, "-", "", .)
	destring(repval), replace
	drop if mi(repval)
	gen repval_thou = repval/1000
	
	gen downpayment = (OriginalPropertyValue - OriginalLoanAmount)/1000
	
	
	replace OriginalLoanAmount = OriginalLoanAmount / 1000
	replace OriginalPropertyValue = OriginalPropertyValue / 1000
	reghdfe downpayment b1.repval_cat##I_SHFA_final OriginalPropertyValue if repval_cat>0, cl(FIPS) absorb(fegroup)
	parmest,format(estimate min95 max95 %8.4f p %8.4e) saving($repoutput/parmest_cap_repval_loanamt, replace) 
	
	use $repoutput/parmest_cap_repval_loanamt, clear 
	split(parm), parse(#)
	gen group = "int" if strpos(parm2, "I_SHFA_final")>0
	replace group = "" if strpos(parm2, "0b")>0	
	keep if !mi(group)
	drop parm2 group 
	rename parm1 repval_cat 
	replace repval_cat = subinstr(repval_cat, ".repval_cat", "", .)
	rename repval_cat repval_cat_str

	destring(repval_cat_str), gen(repval_cat) force	
	replace repval_cat = 1 if repval_cat_str=="1b"
	gen repval = . 
	replace repval =  0 if repval_cat == 0
	replace repval =  75000 if repval_cat == 1
	replace repval =  100000 if repval_cat == 2
	replace repval =  125000 if repval_cat == 3
	replace repval =  150000 if repval_cat == 4
	replace repval =  175000 if repval_cat == 5
	replace repval =  200000 if repval_cat == 6
	replace repval =  225000 if repval_cat == 7
	replace repval =  250000 if repval_cat == 8
	replace repval =  275000 if repval_cat == 9
	replace repval =  300000 if repval_cat == 10
	replace repval =  325000 if repval_cat == 11
	replace repval =  350000 if repval_cat == 12
	replace repval =  375000 if repval_cat == 13
	replace repval =  400000 if repval_cat == 14
	replace repval =  425000 if repval_cat == 15
	replace repval =  450000 if repval_cat == 16
	replace repval =  475000 if repval_cat == 17
	replace repval =  500000 if repval_cat == 18

	gen repval2 = repval/1000

	format repval %15.2gc
	format estimate %15.0gc
	
	graph twoway ///
		(scatter estimate repval2, color("$pgp_blue")) ///
		(rcap min95 max95 repval2, color("$pgp_blue")), ///
		yline(0, lcolor(black)) ///
		xline(250, lcolor(cranberry)) ///
		xlab(, labsize(large))  ///
		ylab(, labsize(large)) ///
		graphregion(fcolor(white) lcolor(white) ) ///
		legend(order(1 "Estimate" 2 "95% Confidence Interval") region(lcolor(white)) size(large)) ///
		xtitle("Replacement Cost (Thousands)", size(large)) ytitle("Coefficient Estimates {&phi}{sub:k}" "(Thousands)", size(large)) title("")
	graph export "$repoutput/repval_rkd_coeff_loanamt.png", as(png) replace 
		

	
	
		
**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.6
**-----------------------------------------------------------------------------------------------------------------

	use "$repfinaldata/matchedloans_finalsample.dta", clear 


		
	binscatter2 I_gse r2_thou, line(none)  ///
			legend(order(1 "Outside Flood Zone" 2 "Flood Zone") region(lcolor(white)) size(large)) ///
			color("$pgp_blue" "$pgp_red" ) msymbols(O T)  ///
			xlab(, labsize(large)) ylab(, labsize(large)) ///
			title("") ytitle("Fraction Sold to the GSEs", size(large)) ///
			xline(250, lcolor(cranberry)) ///
			ylab(0(.05).35) ///
			xtitle("Replacement Cost (Thousands)", size(large))
			graph export "$repoutput/binscatter_kept_repcost.png", as(png) replace 


	binscatter2 I_gse r2_thou, line(none) control(log_OriginalPropertyValue) ///
			legend(order(1 "Outside Flood Zone" 2 "Flood Zone") region(lcolor(white)) size(large)) ///
			color("$pgp_blue" "$pgp_red" ) msymbols(O T)  ///
			xlab(, labsize(large)) ylab(, labsize(large)) ///
			title("") ytitle("Fraction Sold to the GSEs", size(large)) ///
			xline(250, lcolor(cranberry)) ///
			ylab(0(.05).35) ///
			xtitle("Replacement Cost (Thousands)", size(large))		
			graph export "$repoutput/binscatter_kept_repcost_propval.png", as(png) replace 

	binscatter2 I_gse r2_thou, by(I_SHFA) line(none) control(log_OriginalPropertyValue) ///
			legend(order(1 "Outside Flood Zone" 2 "Flood Zone") region(lcolor(white)) size(large)) ///
			color("$pgp_blue" "$pgp_red" ) msymbols(O T)  ///
			xlab(, labsize(large)) ylab(, labsize(large)) ///
			title("") ytitle("Fraction Sold to the GSEs", size(large)) ///
			xline(250, lcolor(cranberry)) ///
			ylab(0(.05).35) ///
			xtitle("Replacement Cost (Thousands)", size(large))		
			graph export "$repoutput/binscatter_kept_repcost_propval_fz.png", as(png) replace 		


**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.7
**-----------------------------------------------------------------------------------------------------------------

			
	use "$repfinaldata/matchedloans_finalsample.dta", clear 
	* generate replacement cost categories
	
	gen hval_thou = OriginalPropertyValue / 1000
	summ r2, d
	egen repval_cat = cut(r2), at(0 75000 100000 125000 150000 175000 200000 225000 250000 275000 300000 325000 350000 375000 400000 425000 450000 475000 500000 `r(max)') label
	tabstat r2, by(repval_cat) stat(min max mean)
	format r2_thou hval_thou %9.4gc
	decode(repval_cat), gen(repval)
	replace repval = subinstr(repval, "-", "", .)
	destring(repval), replace
	drop if mi(repval)
	gen repval_thou = repval/1000
	
	collapse (mean) mean_hval_thou=hval_thou (p25) p25_hval_thou=hval_thou (p75) p75_hval_thou=hval_thou (p50) p50_hval_thou=hval_thou,  ///
		by(repval_cat)
	decode(repval_cat), gen(repval)
	replace repval = subinstr(repval, "-", "", .)
	destring(repval), replace
	drop if mi(repval)
	gen repval_thou = repval/1000
	graph twoway scatter p25 mean p50 p75 repval_thou if repval_cat>0, ///
		xline(250, lcolor(cranberry)) yline(417, lcolor(cranberry)) ///
		xtitle("Replacement Costs (Thousands)", size(large)) ytitle("Property Value (Thousands)", size(large)) ///
		xlab(, labsize(large)) ylab(, labsize(large)) ///
		legend(order(1 "p25" 2 "mean" 3 "median" 4 "p75") size(large)) ///
		msymbol(O D T S X)
		graph export "$repoutput/scatter_hval_r2_distribution.png", as(png) replace 
	clear

		
**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.8 
**-----------------------------------------------------------------------------------------------------------------

	*create a list of counties in Florida 
	use $repfinaldata/eventstudy_parcel_FL13, clear 
	keep FIPS 
	duplicates drop 
	set obs 67
	replace FIPS = 12127 if _n==65
	replace FIPS =12105 if _n==66
	replace FIPS =12115 if _n==67
	tempfile countylist 
	save `countylist' 
	
	
	use $repfinaldata/eventstudy_parcel_FL13, clear 			
	cap noi gen year_map1 = year(dofm(rev_date1_my))
	tab fz_grew3 if noremap==1
	keep if fz_grew3==1 | noremap==1
	keep FIPS year_rev year_map1 noremap
	duplicates drop 
	
	merge 1:1 FIPS using `countylist' 
	gen county = FIPS 
	gen state="FL"
	gen year_rev2 = year_rev 
	replace year_rev2 = . if inrange(year_map1, 1998, 2007) & noremap==1
	replace year_rev2 = . if year_rev==2011
	replace year_rev2 = . if year_rev==2015
	
	tab year_rev2 
	count if mi(year_rev2)
	
	maptile year_rev2, geo(county2010) mapif(state=="FL") ///
		legdecimals(0) ///
		ndfcolor(gs11) ///
		fcolor(Blues2) ///
		spopt(legend(pos(7) ring(0) label(1 "Excluded") ///
			lab(2 "Remapped in 2012") lab(3 "Remapped in 2013") lab(4 "Remapped in 2014") ///
			size(medlarge)))
	graph export "$repoutput/florida_map_yearremmapped.png", as(png) replace 
	


**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.9 
**-----------------------------------------------------------------------------------------------------------------
	
	use $repfinaldata/eventstudy_parcel_FL13, clear 
	
	// graph settings 
	local ylab_jumbo = "ylab(, labsize(large))"
	
	est drop _all 
		
	reghdfe JumboAtOriginationFlag b9.event_time_y2 if fz_grew3==1, absorb(county year) cl(county)
	est store emain

	coefplot emain, vertical base ///
		keep(7.event_time_y2 8.event_time_y2 9.event_time_y2 10.event_time_y2 11.event_time_y2 12.event_time_y2 13.event_time_y2) ///
		rename(	7.event_time_y2="-3" ///
			8.event_time_y2="-2" ///
			9.event_time_y2="-1" ///
			10.event_time_y2 = "0" ///
			11.event_time_y2 = "1" ///
			12.event_time_y2 = "2" ///
			13.event_time_y2 = "3") ///
		yline(0) `ylab_jumbo' ///
			xlab(,labsize(large)) ///
		xtitle("Years Since Updated Map Released", size(large)) mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap))
	graph export "$repoutput/ejumbo.png", replace
	
	
**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.10
**-----------------------------------------------------------------------------------------------------------------
	use $repfinaldata/eventstudy_parcel_FL13, clear 

	// collapse data 	
	keep county ZIP year year_rev fz_grew3 noremap2 fec_repub_share openfema_building_ded openfema_contents_ded
	order county ZIP year year_rev fz_grew3 noremap2 fec_repub_share openfema_building_ded openfema_contents_ded
	duplicates drop 
	sort county ZIP year 
	bys county ZIP year: gen dups = _N
	tab dups if fz_grew3==1 
	gen event_time = year - year_rev 
	replace event_time = . if fz_grew3==0 | noremap2==1
	gen event_time_y2 = event_time + 10 	
	gen Post = event_time > 0 
	
	// regressions 
	*beliefs 	
	reghdfe fec_repub_share b9.event_time_y2 if fz_grew3==1, absorb(county year) cl(county)
	est sto ebeliefs 
	
	coefplot ebeliefs, vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0) ylab(, labsize(large)) xlab(, labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
			
	graph export "$repoutput/efec_repubshare.png", as(png) replace 
	
	*risk aversion   
	reghdfe openfema_building_ded b9.event_time_y2 if fz_grew3==1, absorb(county year) cl(county)
	est sto ebuilding_ded  
	
	coefplot ebuilding_ded, vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons openfema_premium openfema_building_cov) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0) ylab(-100(50)100, labsize(large)) xlab(, labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
				
	graph export "$repoutput/ebuilding_ded.png", as(png) replace 
	
	*risk aversion   
	reghdfe openfema_contents_ded  b9.event_time_y2 if fz_grew3==1, absorb(county year) cl(county)
	est sto econtents_ded  
	
	coefplot econtents_ded, vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons openfema_premium openfema_contents_cov) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0) ylab(-100(50)100, labsize(large)) xlab(, labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	
	graph export "$repoutput/econtents_ded.png", as(png) replace 
	
	
**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.11
**-----------------------------------------------------------------------------------------------------------------
	
	use $repfinaldata/eventstudy_parcel_FL13, clear 
	
	est drop _all 
	
	reghdfe OriginalLTV  b9.event_time_y2 if nevertreated == 1, absorb(county year) cl(county)
	est store enoremap
	
	coefplot enoremap, vertical base ///
		drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons) ///
		rename(	7.event_time_y2="-3" ///
			8.event_time_y2="-2" ///
			9.event_time_y2="-1" ///
			10.event_time_y2 = "0" ///
			11.event_time_y2 = "1" ///
			12.event_time_y2 = "2" ///
			13.event_time_y2 = "3") ///
		yline(0)  ylab(, labsize(large)) ///
		xlab(,labsize(large)) ///
		xtitle("Years Since Updated Map Released", size(large)) mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/eOriginalLTV_noremap.png", replace
	
	
	 
	
	reghdfe log_income b9.event_time_y2 if nevertreated ==1, absorb(county year) cl(county)
	est store enoremap_income
	
	coefplot enoremap_income, vertical base ///
		drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons) ///
		rename(	7.event_time_y2="-3" ///
			8.event_time_y2="-2" ///
			9.event_time_y2="-1" ///
			10.event_time_y2 = "0" ///
			11.event_time_y2 = "1" ///
			12.event_time_y2 = "2" ///
			13.event_time_y2 = "3") ///
		yline(0)  ylab(, labsize(large)) ///
		xlab(,labsize(large)) ///
		xtitle("Years Since Updated Map Released", size(large)) mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/elog_hmda_income_noremap.png", replace

	
	reghdfe OriginalCreditScore b9.event_time_y2 if nevertreated == 1 , absorb(county year) cl(county)
	est store enoremap_credit
	
	coefplot enoremap_credit, vertical base ///
		drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons) ///
		rename(	7.event_time_y2="-3" ///
			8.event_time_y2="-2" ///
			9.event_time_y2="-1" ///
			10.event_time_y2 = "0" ///
			11.event_time_y2 = "1" ///
			12.event_time_y2 = "2" ///
			13.event_time_y2 = "3") ///
		yline(0)  ylab(, labsize(large)) ///
		xlab(,labsize(large)) ///
		xtitle("Years Since Updated Map Released", size(large)) mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/eOriginalCreditScore_noremap.png", replace
	
**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.12
**-----------------------------------------------------------------------------------------------------------------	
	use $repfinaldata/eventstudy_parcel_FL13, clear 

	reghdfe OriginalLTV b9.event_time_y2 if fz_grew3==1 , absorb(county year) cl(county)
	est store fz_1
	reghdfe OriginalLTV b9.event_time_y2 if placebo_grp==1 , absorb(county year) cl(county) // floodzone contracts by less than .01
	est store fz_2
	
	coefplot ///
		(fz_1, label("Flood Zone Expands") mcolor("$pgp_red") msymbol(T) ciopts(lcolor("$pgp_red") recast(rcap))) ///
		(fz_2, label("Placebo Group") mcolor("$pgp_blue") msymbol(O) ciopts(lcolor("$pgp_blue") recast(rcap))), ///
		vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons ///
			$controls_es OriginalInterestRate log_OriginalPropertyValue) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0)  msymbol(O) ///
			ylab(, labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) 
	graph export "$repoutput/eOriginalLTV_byfzgrew3.png", replace		

	
	reghdfe log_income b9.event_time_y2 if fz_grew3==1 , absorb(county year) cl(county)
	est store fz_1_income
	reghdfe log_income  b9.event_time_y2 if placebo_grp==1  , absorb(county year) cl(county) // floodzone contracts by less than .01
	est store fz_2_income
	
	coefplot ///
		(fz_1_income, label("Flood Zone Expands") mcolor("$pgp_red") msymbol(T)  ciopts(lcolor("$pgp_red") recast(rcap))) ///
		(fz_2_income, label("Placebo Group") mcolor("$pgp_blue") msymbol(O) ciopts(lcolor("$pgp_blue") recast(rcap))), ///
		vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons ///
			$controls_es OriginalInterestRate log_OriginalPropertyValue) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0)  msymbol(O) ///
			ylab(,labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) 
	graph export "$repoutput/eLogIncome_byfzgrew3.png", replace
	
	
	reghdfe OriginalCreditScore b9.event_time_y2 if fz_grew3==1, absorb(county year) cl(county)
	est store fz_1_cs
	reghdfe OriginalCreditScore   b9.event_time_y2 if placebo_grp==1 , absorb(county year) cl(county) // floodzone contracts by less than .01
	est store fz_2_cs
	
	coefplot ///
		(fz_1_cs, label("Flood Zone Expands") mcolor("$pgp_red") msymbol(T) ciopts(lcolor("$pgp_red") recast(rcap))) ///
		(fz_2_cs, label("Placebo Group") mcolor("$pgp_blue") msymbol(O) ciopts(lcolor("$pgp_blue") recast(rcap))), ///
		vertical base ///
			drop(4.event_time_y2 5.event_time_y2 6.event_time_y2 14.event_time_y2 15.event_time_y2 _cons ///
			$controls_es OriginalInterestRate log_OriginalPropertyValue) ///
			rename(	7.event_time_y2="-3" ///
				8.event_time_y2="-2" ///
				9.event_time_y2="-1" ///
				10.event_time_y2 = "0" ///
				11.event_time_y2 = "1" ///
				12.event_time_y2 = "2" ///
				13.event_time_y2 = "3") ///
			yline(0)  msymbol(O) ///
			ylab(, labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) 
	graph export "$repoutput/eCreditScore_byfzgrew3.png", replace


**--------------------------------------------------------------------------------------------------------------------
** FIGURE A.13
**-----------------------------------------------------------------------------------------------------------------
	use $repfinaldata/eventstudy_parcel_FL13, clear 

	*Panel A
	reghdfe OriginalLTV b2011.year##i.treated, absorb(year treated) cl(county) 
	est sto eltv_2012
	
	coefplot eltv_2012, vertical base ///
			keep( 2010.year#1.treated 2011.year#0.treated 2012.year#1.treated ///
				2013.year#1.treated 2014.year#1.treated 2015.year#1.treated 2016.year#1.treated) ///
			rename(	2010.year#1.treated= "2010" ///
				2011.year#0.treated= "2011" ///
				2012.year#1.treated = "2012" ///
				2013.year#1.treated= "2013" ///
				2014.year#1.treated= "2014" ///
				2015.year#1.treated= "2015" ///
				2016.year#1.treated = "2016") ///
			yline(0) ylab(,  labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/eOriginalLTV_2012.png", replace
	
	*Panel B 
	reghdfe log_income b2011.year##i.treated, absorb(year treated) cl(county) 
	est sto eincome_2012
	
	coefplot eincome_2012, vertical base ///
			keep( 2010.year#1.treated 2011.year#0.treated 2012.year#1.treated ///
				2013.year#1.treated 2014.year#1.treated 2015.year#1.treated 2016.year#1.treated) ///
			rename(	2010.year#1.treated= "2010" ///
				2011.year#0.treated= "2011" ///
				2012.year#1.treated = "2012" ///
				2013.year#1.treated= "2013" ///
				2014.year#1.treated= "2014" ///
				2015.year#1.treated= "2015" ///
				2016.year#1.treated = "2016") ///
			yline(0) ylab(,  labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/elog_hmda_income_2012.png", replace
	
	*Panel C 
	reghdfe OriginalCreditScore b2011.year##i.treated, absorb(year treated) cl(county) 
	est sto ecscore_2012
	
	coefplot ecscore_2012, vertical base ///
			keep( 2010.year#1.treated 2011.year#0.treated 2012.year#1.treated ///
				2013.year#1.treated 2014.year#1.treated 2015.year#1.treated 2016.year#1.treated) ///
			rename(	2010.year#1.treated= "2010" ///
				2011.year#0.treated= "2011" ///
				2012.year#1.treated = "2012" ///
				2013.year#1.treated= "2013" ///
				2014.year#1.treated= "2014" ///
				2015.year#1.treated= "2015" ///
				2016.year#1.treated = "2016") ///
			yline(0) ylab(,  labsize(large)) ///
			xlab(,labsize(large)) ///
			xtitle("Years Since Updated Map Released", size(large)) ///
			mcolor("$pgp_blue") ciopts(lcolor("$pgp_blue") recast(rcap)) 
	graph export "$repoutput/ecreditscore_2012.png", replace
	